package net.melon.product.pojo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import net.esj.basic.pojo.AbstractPojo;

public class Product extends AbstractPojo<String>{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -6200520259135341602L;
	
	public static enum PRODUCT_ENABLE{
		YES(1),
		NO(2);
		private int marketEnable;
		
		private PRODUCT_ENABLE(int marketEnable){
			this.marketEnable = marketEnable;
		}
		
		public static PRODUCT_ENABLE valueOf(int marketEnable){
			for(PRODUCT_ENABLE st : values()){
				if(st.getMarketEnable() == marketEnable){
					return st;
				}
			}
			return null;
		}

		public int getMarketEnable() {
			return marketEnable;
		}

		public void setMarketEnable(int marketEnable) {
			this.marketEnable = marketEnable;
		}
		
	}
	
	public static final String ICON_SUB_DIR = "ml_product_icon";

	private String id;
	
	private String name;
	
	private double price;//优惠价
	
	private int state;//1,-1
	
	private String serial;//编号
	
	private Long classifyId;
	
	private int marketEnable; //是否上架 1：是,2否
	
	private double guidePrice;//指导价
	
	private double floorReferencePrice;//落地价
	
	private int stock;//库存
	
	private int sell;//销售
	
	private double click;//点击量
	
	private Date marketTime;//上架时间
	
	private String content;//详情
	
	private double reserveGold = 1000;//预约金
	
	//dto
	
	private String icon;
	
	private ProductClassify classify;
	
	private List<ProductImage> images = new ArrayList<ProductImage>();
	
	private List<ProductSpecificationsLink> specifications = new ArrayList<ProductSpecificationsLink>();
	
	public Product() {
	}

	public Product(String id) {
		this.id = id;
	}
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public ProductClassify getClassify() {
		return classify;
	}

	public void setClassify(ProductClassify classify) {
		this.classify = classify;
	}

	public String getSerial() {
		return serial;
	}

	public void setSerial(String serial) {
		this.serial = serial;
	}

	public Long getClassifyId() {
		return classifyId;
	}

	public void setClassifyId(Long classifyId) {
		this.classifyId = classifyId;
	}

	public List<ProductImage> getImages() {
		return images;
	}

	public void setImages(List<ProductImage> images) {
		this.images = images;
	}

	public List<ProductSpecificationsLink> getSpecifications() {
		return specifications;
	}
	
	public String getSpecifications(long specificationsValue) {
		for(ProductSpecificationsLink pl : specifications){
			if(pl.getSpecificationsValue()==specificationsValue){
				return pl.getValue();
			}
		}
		return "";
	}

	public void setSpecifications(List<ProductSpecificationsLink> specifications) {
		this.specifications = specifications;
	}

	public int getMarketEnable() {
		return marketEnable;
	}

	public void setMarketEnable(int marketEnable) {
		this.marketEnable = marketEnable;
	}

	public int getStock() {
		return stock;
	}

	public void setStock(int stock) {
		this.stock = stock;
	}

	public int getSell() {
		return sell;
	}

	public void setSell(int sell) {
		this.sell = sell;
	}

	public double getClick() {
		return click;
	}

	public void setClick(double click) {
		this.click = click;
	}

	public double getGuidePrice() {
		return guidePrice;
	}

	public void setGuidePrice(double guidePrice) {
		this.guidePrice = guidePrice;
	}

	public double getFloorReferencePrice() {
		return floorReferencePrice;
	}

	public void setFloorReferencePrice(double floorReferencePrice) {
		this.floorReferencePrice = floorReferencePrice;
	}

	public Date getMarketTime() {
		return marketTime;
	}

	public void setMarketTime(Date marketTime) {
		this.marketTime = marketTime;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public double getReserveGold() {
		return reserveGold;
	}

	public void setReserveGold(double reserveGold) {
		this.reserveGold = reserveGold;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}
	
}
